#ifndef COLORTHEMEDIALOG_H
#define COLORTHEMEDIALOG_H
//编辑器选项对话框
#include "codeeditor.h"

class ColorThemeDialog : public QDialog
{
    Q_OBJECT
public:
    ColorThemeDialog(QWidget *parent = 0); //构造函数

private:
    QLabel *themeLabel=nullptr;

    CodeEditor *codeEditor = nullptr;

    QPushButton *keywordButton = nullptr;
    QPushButton *functionButton = nullptr;
    QPushButton *numberButton = nullptr;
    QPushButton *qtClassButton = nullptr;
    QPushButton *preprocessButton = nullptr;
    QPushButton *commentButton = nullptr;
    QPushButton *stringButton = nullptr;
    QPushButton *symbolButton = nullptr;
    QPushButton *foregroundButton = nullptr;

    QPushButton *okButton = nullptr; //定义OK按钮
    QPushButton *defaultButton = nullptr; //定义Default按钮
    QPushButton *cancelButton = nullptr; //定义Cancel按钮

    QList<QColor> backKeywordColor;
    QList<QColor> backFunctionColor;
    QList<QColor> backNumberColor;
    QList<QColor> backQtClassColor;
    QList<QColor> backPreprocessColor;
    QList<QColor> backCommentColor;
    QList<QColor> backStringColor;
    QList<QColor> backSymbolColor;
    QList<QColor> backEditorForeground;

    void changeButtonsTextColor();
    void buttonClicked();
    void showEvent(QShowEvent* event);
    void okButtonClicked(); //OK按钮点击时的处理函数
    void defaultButtonClicked(); //Default按钮点击时的处理函数
    void cancelButtonClicked(); //Cancel按钮点击时的处理函数
};
#endif
